oxenstored: blame the connection that caused a transaction conflict
authorJonathan Davies <jonathan.davies@citrix.com>
Thu, 23 Mar 2017 14:28:16 +0000 (14:28 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 28 Mar 2017 12:07:04 +0000 (13:07 +0100)
commit8ddbce0426ca4bea0ebc80479aa14f22f590e7af
tree02c567a724be27d4ae32fe6dc513a7ae4140bdbd
parent57718f2e14b7cf81515b91199d8cfead644c3197
oxenstored: blame the connection that caused a transaction conflict

Blame each connection found to have made a commit that would cause this
transaction to fail. Each blamed connection is penalised by having its
conflict-credit decremented.

Note the change in semantics for the replay function: we no longer stop after
finding the first operation that can't be replayed. This allows us to identify
all operations that conflicted with this transaction, not just the one that
conflicted first.

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
v1 Reviewed-by: Christian Lindig <christian.lindig@citrix.com>

Changes since v1:
 * use correct log levels for informational messages
Changes since v2:
 * fix the blame algorithm and improve logging
   (fix was reviewed by Jonathan Davies)

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
tools/ocaml/xenstored/history.ml
tools/ocaml/xenstored/process.ml